#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

#define FOR(i,a,n) for(int i=a,_n(n);i<_n;++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

string num;
int n,k;

bool Judge(int pos)
{
    if(pos>=n-2) return false;
    if(num[pos]=='4'&&num[pos+2]=='7'&&
       (num[pos+1]=='4'||num[pos+1]=='7')) return true;
    return false;
}

void PrintAns()
{
    REP(i,n-1)
    {
        if(!k) break;
        if((i&1^1)&&Judge(i))
        {
            if(k&1)
            {
                if(num[i+1]=='4') num[i+1] = '7';
                else num[i+1] = '4';
            }
            break;
        }
        if(num[i]=='4'&&num[i+1]=='7')
        {
            --k;
            if(i&1) num[i] = '7';
            else num[i+1] = '4';
        }
    }
    cout<<num<<endl;
}

int main()
{
    while(cin>>n>>k>>num)
    {
        PrintAns();
    }
	return 0;
}
